import Vue from "vue";
import VueRouter from "vue-router";
import Login from "@/views/login";
import Layout from "@/layout";

Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    name: "login",
    component: Login,
    meta: {
      noNeedToken: true,
    },
  },
  {
    path: "/",
    name: "layout",
    component: Layout,
    children: [
      { path: "/data", name: "data", component: () => import("@/views/data") },
      {
        path: "/userList",
        name: "userList",
        component: () => import("@/views/UserList"),
      },
      {
        path: "/examList",
        name: "examList",
        component: () => import("@/views/examList"),
      },
      {
        path: "/EnterpriseList",
        name: "EnterpriseList",
        component: () => import("@/views/EnterpriseList"),
      },
      {
        path: "/subjectList",
        name: "subjectList",
        component: () => import("@/views/subjectList"),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
